package com.andova.tinker;

import com.tencent.tinker.lib.tinker.TinkerInstaller;
import com.tencent.tinker.loader.app.TinkerApplication;
import com.tencent.tinker.loader.shareutil.ShareConstants;

/**
 * Created by Administrator on 2018-09-18.
 *
 * @author kzaxil
 * @since 1.0.0
 */
public class HotfixApplication extends TinkerApplication {
    public HotfixApplication() {
        super(
                //tinkerFlags, tinker支持的类型，dex,library，还是全部都支持！
                ShareConstants.TINKER_ENABLE_ALL,
                //ApplicationLike的实现类，只能传递字符串
                "com.andova.hotfix.HotfixApplicationLike",
                //Tinker的加载器，一般来说用默认的即可
                "com.tencent.tinker.loader.TinkerLoader",
                //tinkerLoadVerifyFlag, 运行加载时是否校验dex与,ib与res的Md5
                false
        );
    }

    public void loadPatch(String path) {
        TinkerInstaller.onReceiveUpgradePatch(this, path);
    }

    public void cleanPatch() {
        TinkerInstaller.cleanPatch(this);
    }
}
